/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * ProcessStatusEnum.java
 */
package com.emm.yixun.common.model.enums;
import java.io.Serializable;
import org.apache.commons.lang.StringUtils;
/**
 * [文件名称]<br>
 * Customer.java<br>
 * <br>
 * [文件描述]<br>
 * 客户信息表 pojo bean<br>
 * <br>
 * [修改记录]<br>
 * 2016-05-13 18:29:13 创建<br>

 * @version 1.00
*/
public enum PositionEnum implements Serializable{
		LIVING_ROOM("1","客厅",null),
		DINING_ROOM("2","餐厅",null),
		HALLWAY("3","玄关",null),
		KITCHEN("4","厨房",null),
		BEDROOM("5","主卧",null),
		SUBALTERN_ROOM("6","次卧",null),
		FIRST_TOILET("7","主卫",null),
		BALCONY("8","阳台",null),
		FACILITY_BALCONY("9","设备阳台",null),
		STUDY("10","书房",null),
		STORE_ROOM("11","储藏室",null),
		CLOAK_ROOM("12","衣帽间",null),
		NURSE_ROOM("13","保姆房",null),
		SECOND_BEDROOM("14","次主卧",null),
		PARENT_ROOM("15","父母房",null),
		CHILD_ROOM("16","儿童房",null),
		CUSTOMER_ROOM("17","客卧",null),
		SECOND_CUSTOMER_ROOM("18","次客卧",null),
		SECOND_TOILET("19","次主卫",null),
		PARENT_TOILET("20","父母房卫生间",null),
		CHILD_TOILET("21","儿童房卫生间",null),
		CUSTOMER_TOILET("22","客卫",null),
		SECOND_CUSTOMER_TOILET("23","次客卫",null),
		PUBLIC_TOILET("24","公卫",null);
		
		private final String no;
		private final String des;
		private final Enum parent;
		
		/**
		 * 私有构造函数
		 * @param code
		 * @param description
		 */
		PositionEnum(String no, String des,Enum parent) {
			this.no = no;
			this.des = des;
			this.parent = parent;
		}

		/**
		 * @return Returns the no.
		 */
		public String getNo() {
			return no;
		}

		/**
		 * @return Returns the des.
		 */
		public String getDes() {
			return des;
		}
		
		/**
		 * @return Returns the parent.
		 */
		public Enum getParent() {
			return parent;
		}

		/**
		 * 通过枚举<code>des</code>获得枚举
		 * 
		 * @param des
		 * @return
		 */
		public static PositionEnum getByDescription(String des) {
			if(StringUtils.isBlank(des)){
				return null;
			}
			for (PositionEnum menum : values()) {
				if (menum.getDes().equals(des)) {
					return menum;
				}
			}
			return null;
		}
		public static PositionEnum getByNo(String no) {
			if(StringUtils.isBlank(no)){
				return null;
			}
			for (PositionEnum menum : values()) {
				if (menum.getNo().equals(no)) {
					return menum;
				}
			}
			return null;
		}
}
